package eventStrategies.physicalModel;

import controller.IController;

import model.IPhysicalDataModel;
import eventManager.AppEvent;
import eventStrategies.IEventResponse;
import events.ECodeEventList;
import events.physicalModel.GetMassEvent;
import events.physicalModel.ReplyGetMassEvent;

public class GetMassStrategy extends IEventResponse {

	private IController controller;
	private IPhysicalDataModel physModel;
	
	public GetMassStrategy(IController controller, IPhysicalDataModel physModel) {
		super(ECodeEventList.GET_MASS);
		this.controller = controller;
		this.physModel = physModel;
	}

	@Override
	public void execute(AppEvent event) {		
		GetMassEvent fullEvent = (GetMassEvent) event;
		
		controller.processOutgoingEvent(new ReplyGetMassEvent(fullEvent.sender, physModel.getMass()));
	}

}
